import request from '@/utils/request'
import { encryptedData } from '@/utils/encrypt'

export function login ({ username, password }) {
  return request({
    url: '/login',
    method: 'post',
    data: {
      username,
      password: encryptedData(password)
    }
  })
}

export function register ({ phoneNum, username, password}) {
  return request({
    url: '/register',
    method: 'post',
    data: {
      phoneNum,
      username,
      password: encryptedData(password)
    }
  })
}

export function getUserInfo () {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

